<?php
	/**
	* Video Widget
	* 
	* @author trungdt
	* @since Oct 28, 2011
	*/
	if (!defined('EXPONENT')) exit('');

	$temp=serialize($loc);	
	// get module config
	$config=$db->selectObject("productsmodule_config", "location_data = '{$temp}'");
	
	// get all new video for playlist
	$video=$db->selectObjects("productsmodule_video","location_data = '{$temp}'   ORDER BY postdate DESC LIMIT 0, 4");
		
	$video=productsmodule::__VideoProcess($video);

	// fetch to template
	$template=new template("productsmodule","_Video_Widget",$loc);
	$template->register_permissions(array('administrate',"configure", "create", "edit", "delete"),$loc);
	$template->assign("video", $video);
	$template->assign("title", $title);
	$template->assign("video_count", count($video));
	$template->output();
?>
